/**
 * 
 */
package com.glodon.paas.document.service;

import java.util.List;
import java.util.Map;

import com.glodon.paas.account.api.bean.User;
import com.glodon.paas.document.api.bean.MemberView;
import com.glodon.paas.document.api.bean.Project;
import com.glodon.paas.document.api.bean.ProjectMember;
import com.glodon.paas.document.api.bean.ProjectMemberAttendees;
import com.glodon.paas.document.api.bean.ProjectResource;
import com.glodon.paas.document.api.bean.ProjectRole;
import com.glodon.paas.document.dao.domain.InvitationEntity;
import com.glodon.paas.document.dao.domain.ProjectMemberEntity;

/**
 * @author xur
 */
public interface ProjectService {

    Project createProject(String userId, String email, String name, String description);

    boolean deleteProject(String userId, String projectId);

    Project getProject(String userId, String projectId);

    Project updateProject(String userId, Project project);

    List<Project> getProjectsByIds(List<String> ids);

    ProjectRole createRole(String userId, String projectId, String roleName);

    List<ProjectRole> getProjectRoles(String userId, String projectId);

    ProjectRole getDefaultRole(String projectId);

    ProjectRole updateRole(String userId, String roleId, String name);

    void deleteRole(String userId, String roleId);

    String insertMember(ProjectMemberEntity entity);

    List<ProjectMember> getMembers(String projectId, String roleId);

    ProjectMember getMemberById(String memberId);

    ProjectMember getConfirmedMember(String userId, String token);

    boolean removeMember(String memberId,boolean deleteMember);

    boolean updateMemberStatus(String memberId, int status);

    boolean insertInvitation(InvitationEntity entity);

    boolean confirmInvitation(String userId, String token);

    boolean updateInvitationStatus(String userId, String token);
    boolean setInvitaionInvalid(String id);
    boolean updateRoleOfMember(String memberId, String projectId, String oldRoleId, String newRoleId);

    List<MemberView> inviteMembers(MemberView member, User owner, String baseUrl);

    boolean reInvite(ProjectMember member, User owner, String baseUrl);

    List<MemberView> showMembers(String projectId, String roleId, String ownerId);

    List<MemberView> showProjectMembers(String projectId, String ownerId);

    // List<Suggestion> showSuggestion(String userId);
    List<Map<String, String>> showSuggestion(String userId);

    List<MemberView> getOrg(String userId, String projectId, String roleId);

    String savePrivilege(String userId, String fileId, String roleId, String[] privileges);

    List<ProjectResource> getFileRolePrivilege(String userId, String fileId, String roleId);
    
    ProjectMemberAttendees getAttendeeById(String id);
    
    ProjectMember getMember(String projectId,String roleId,String memberId);
}
